package proxy;

import java.math.BigDecimal;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @Author: admin
 * @Description:
 * @Date: 2019/6/17 14:21
 */

public class Test {
    public static void main(String[] args) {
        float a5=0.5f-0.25f;
        float b5=0.75f-0.5f;
        System.out.println(a5);
        System.out.println(b5);
        System.out.println(a5==b5);




        float a = 1.0f - 0.9f;
        float b = 0.9f - 0.8f;
        System.out.println(a);
        System.out.println(b);
        if (a == b) {
            System.out.println("true");
        } else {
            System.out.println("false");
        }

        Float a1 = Float.valueOf(1.0f - 0.9f);
        Float b1 = Float.valueOf(0.9f - 0.8f);
        System.out.println(a1);
        System.out.println(b1);
        if (a1.equals(b1)) {
            System.out.println("true");
        } else {
            System.out.println("false");
        }

//        String param = null;
//        switch (param) {
//            case "null":
//                System.out.println("null");
//                break;
//            default:
//                System.out.println("default");
//        }



        BigDecimal ba = new BigDecimal(0.1);
        System.out.println(ba);
        BigDecimal bb = new BigDecimal("0.1");
        System.out.println(bb);


        try {
            lock.tryLock();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            lock.unlock();
        }
    }

    private final static Lock lock = new ReentrantLock();
}
